'use strict';

module.exports = (app) => {
    const {DataTypes} = app.Sequelize;
    const Contact = app.model.define('contact', {
        id: { 
            type: DataTypes.UUID,
            defaultValue: app.Sequelize.UUIDV4, 
            primaryKey: true,
            notNull: true,
            comment: 'ID'
        },
        personNum:{type:DataTypes.INTEGER ,notNull:true,comment: 'personNum'},
        musicName:{type: DataTypes.STRING(50),notNull:true,comment: 'musicName'},
        timer:{type: DataTypes.STRING(50),notNull:true,comment: 'timer'},
        otherRequirement:{type: DataTypes.STRING(500),notNull:true,comment: 'otherRequirement'},
        ip: {type: DataTypes.STRING(20),isIP: true,comment: 'IP'},
        address: {type: DataTypes.STRING(20),comment: '地区'},
        contact: {type: DataTypes.STRING(100),comment: '联系'},
        weixin: {type: DataTypes.STRING(100),comment: '联系'},
    },
  );
  Contact.sync()
  return Contact;
};